package com.dragonfly.shutter.stub;

import java.util.List;

import com.dragonfly.shutter.DAOs.UserDAO;
import com.dragonfly.shutter.beans.RegisterBean;
import com.dragonfly.shutter.beans.UserBrief;
import com.dragonfly.shutter.beans.UserDetail;
import com.dragonfly.shutter.beans.UserLogin;

/**
 * 测试时的桩类，模拟UserDAO进行关于用户的数据库操作
 * @author 金灵杰
 *
 */
public class UserDAOStub implements UserDAO {
	private UserLogin userLogin = null;
	private UserDetail userDetail = null;
	private int updatePasswordRet = 0;
	private UserBrief userBrief = null;
	private RegisterBean registerBean;
	
	/**
	 * @return the userBrief
	 */
	public UserBrief getUserBrief() {
		return userBrief;
	}

	/**
	 * @param userBrief the userBrief to set
	 */
	public void setUserBrief(UserBrief userBrief) {
		this.userBrief = userBrief;
	}

	@Override
	public Integer insertNewRegisterUser(UserLogin userLogin) {
		return null;
	}

	@Override
	public Integer insertUser(UserDetail user) {
		return null;
	}

	/**
	 * 模拟返回用户登录信息
	 */
	@Override
	public UserLogin selectLoginInfoByEmail(String email) {
		return userLogin;
	}

	@Override
	public List<UserBrief> selectPagedUserBriefInfo(String userName,
			Integer minRow, Integer maxRow) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public UserBrief selectUserBriefInfoByUserId(Integer usrID) {
		return userBrief;
	}

	@Override
	public Integer selectUserCountByUserName(String userName) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public int updateFlagLogin(UserDetail userDetail) {
		return 0;
	}

	@Override
	public int updateFlagUpload(UserDetail userDetail) {
		return 0;
	}

	@Override
	public int updatePassword(UserDetail userDetail) {
		return updatePasswordRet;
	}

	@Override
	public int updateUser(UserDetail userDetail) {
		return 0;
	}

	/**
	 * @param userLogin the userLogin to set
	 */
	public void setUserLogin(UserLogin userLogin) {
		this.userLogin = userLogin;
	}

	/**
	 * @return the userLogin
	 */
	public UserLogin getUserLogin() {
		return userLogin;
	}

	/**
	 * 模拟插入注册信息
	 */
	@Override
	public Integer insertRegisterBean(RegisterBean registerBean) {
		this.setRegisterBean(registerBean);
		return null;
	}

	@Override
	public UserDetail selectUserByEmail(String email) {
		return userDetail;
	}

	@Override
	public UserDetail selectUserByUserId(Integer userID) {
		// TODO Auto-generated method stub
		return null;
	}

	/**
	 * @param userDetail the userDetail to set
	 */
	public void setUserDetail(UserDetail userDetail) {
		this.userDetail = userDetail;
	}

	/**
	 * @return the userDetail
	 */
	public UserDetail getUserDetail() {
		return userDetail;
	}

	/**
	 * @param updatePasswordRet the updatePasswordRet to set
	 */
	public void setUpdatePasswordRet(int updatePasswordRet) {
		this.updatePasswordRet = updatePasswordRet;
	}

	/**
	 * @return the updatePasswordRet
	 */
	public int getUpdatePasswordRet() {
		return updatePasswordRet;
	}

	@Override
	public Integer updateFlagActive(UserDetail user) {
		return null;
	}

	/**
	 * @param registerBean the registerBean to set
	 */
	public void setRegisterBean(RegisterBean registerBean) {
		this.registerBean = registerBean;
	}

	/**
	 * @return the registerBean
	 */
	public RegisterBean getRegisterBean() {
		return registerBean;
	}

	@Override
	public Integer selectUserPoint(Integer userID) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public int updateScore(Integer userID, Integer point) {
		// TODO Auto-generated method stub
		return 0;
	}

}
